function createBuffers(bufs, scopeRange = 200) {
  const gsonline = turf.lineString(bufs);
  // console.log(gsonline)
  const endindex = gsonline.geometry.coordinates.length - 1;

  // 线的起点的左边
  const lsl = turf.transformRotate(gsonline, -90, {
    pivot: gsonline.geometry.coordinates[0],
  });

  // 线的起点的右边
  const lsr = turf.transformRotate(gsonline, 90, {
    pivot: gsonline.geometry.coordinates[0],
  });

  // 线的终点的左边
  const lel = turf.transformRotate(gsonline, 90, {
    pivot: gsonline.geometry.coordinates[endindex],
  });

  // 线的终点的右边
  const ler = turf.transformRotate(gsonline, -90, {
    pivot: gsonline.geometry.coordinates[endindex],
  });

  const buffered = turf.buffer(gsonline, scopeRange, {
    units: "meters",
  });

  // 构建buffer为点featureCollection
  const bufferedtoline = turf.polygonToLine(buffered);
  let pointsarr = [];
  bufferedtoline.geometry.coordinates.forEach((coord) => {
    const point = turf.point(coord);
    pointsarr.push(point);
  });
  var points = turf.featureCollection(pointsarr);

  // 遍历找出4个点(垂线与buffer相交的点)
  const four_gline = [lel, lsl, lsr, ler];
  let intersectpointarr = [];
  four_gline.forEach((i) => {
    var intersects = turf.lineIntersect(i, buffered);
    const intersectpoint = intersects.features[0];
    intersectpointarr.push(intersectpoint);
  });

  let four_index = [];
  intersectpointarr.forEach((i) => {
    var nearest = turf.nearestPoint(i, points);
    four_index.push(nearest.properties.featureIndex);
  });

  const splicetop = four_index[3] - four_index[0];
  const splicebtm = four_index[1] - four_index[2];
  const bufferedcoordarry = buffered.geometry.coordinates[0];

  bufferedcoordarry.splice(four_index[0] + 1, splicetop - 1);
  bufferedcoordarry.splice(four_index[2] + 2 - splicetop, splicebtm - 1);
  const buffes = [];
  bufferedcoordarry.forEach(function (res) {
    var point = new AMap.LngLat(res[0], res[1]);
    var lat_x = [res[0], res[1]];
    buffes.push(point);
  });
  return buffes;
  console.log(buffes);
  // 判断设备和缓冲区位置关系true/false
  // PointInPolygon(bufferedcoordarry,id);

  // const polygon = L.polygon(buffes,{
  //     weight:2,
  //     dashArray:10,
  //     color: '#1AF61B',
  //     fillColor: '#22f222',
  //     fillOpacity: 0.1
  // }).addTo(map)

  // var styleOptions = {strokeColor:"#ffe600",fillColor:"#7fb80e",fillOpacity: 0.2,strokeStyle:"dashed", strokeWeight:4, strokeOpacity:0.6}
  //   var styleOptions = {
  //     strokeColor: "#ffe600",
  //     fillColor: "#7fb80e",
  //     fillOpacity: 0.2,
  //     strokeWeight: 3,
  //     strokeOpacity: 0.6,
  //     enableMassClear: false,
  //   };

  //   const polygon = new AMap.Polygon(buffes, styleOptions);
  //   map.addOverlay(polygon); //增加折线
}
